.PHONY: all
all: tools/gen-expr/input build/riscv32-test_expr
tools/gen-expr/build/gen-expr: tools/gen-expr/gen-expr.c
	make -C tools/gen-expr
tools/gen-expr/input: tools/gen-expr/build/gen-expr
	$< 10000 > $@
# 参数-lLLVM-20需要加上
build/obj-riscv32-nemu-interpreter/src/test_expr.o: src/test_expr.c
	gcc -MMD -Wall -Werror -Isrc/monitor/sdb -Iinclude  -Og -ggdb3  -DITRACE_COND=true -D__GUEST_ISA__=riscv32 -c -o $@ $<
build/riscv32-test_expr: build/obj-riscv32-nemu-interpreter/src/test_expr.o build/obj-riscv32-nemu-interpreter/src/monitor/sdb/expr.o
	g++ -o $@ -Og -ggdb3 -lLLVM-20 -lreadline -ldl -pie $(shell find build/obj-riscv32-nemu-interpreter/src -not -path build/obj-riscv32-nemu-interpreter/src/nemu-main.o -name "*.o")
